package com.wenhao.newcode.FakeExam;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long a = scanner.nextLong();
        long b = scanner.nextLong();
        long c = scanner.nextLong();
        double result = a + (0.5 * b - 0.5 * c) / 1.5;
        if (result <= 0) {
            System.out.println(0);
        } else {
            System.out.println((long)Math.ceil(result));
        }
    }
}
